{include file="public/header" /}
<style>
    .layui-form-checkbox i {
        border-left: 1px solid #d2d2d2;
    }

    .hidden {
        display: none;
    }

    .layui-form-item {
        margin-top: 0;
        margin-bottom: 0;
    }

    .ibox-title {
        min-height: 45px;
        line-height: 45px;
        display: block;
        padding: 10px;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox-content layui-form">
        <div class="layui-row layui-col-space10 layui-form-item ">
            <input type="hidden" name="order_id" value="{$data.order_id}">
            <input type="hidden" name="type" value="{$type}">
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">回寄方式：</label>
                <div class="layui-input-block">
                    <input type="radio" name="order_company_express_type" value="1" title="包装出货"
                           {$data.order_company_express_type== 1 ? 'checked' : ''} lay-filter="showExpre">
                    <input type="radio" name="order_company_express_type" value="2" title="入CUS库"
                           {$data.order_company_express_type== 2 ? 'checked' : ''} lay-filter="showExpre">
                    <input type="radio" name="order_company_express_type" value="3" title="入RMASAC库"
                           {$data.order_company_express_type== 3 ? 'checked' : ''} lay-filter="showExpre">
                </div>
            </div>
            <div class="showwuliu {$data.order_company_express_type == 1 ? '' : 'hidden'}">
                <div class="ibox-title" style="clear: both;">
                    <h5>物流1</h5>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_name" class="layui-input" value="{$data.order_user_name}">
                    </div>
                    <label class="layui-form-label">收件人电话：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_phone" maxlength="11" class="layui-input "
                               value="{$data.order_user_phone}">
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="order_user_address" class="layui-input "
                               value="{$data.order_user_address}">
                    </div>
                </div>
                <!---->

                <!---->
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs12">
                    <label class="layui-form-label">物流公司：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_company"
                               placeholder="请输入物流公司" class="layui-input" value="{$data.order_company_express_company}">
                    </div>
                    <label class="layui-form-label">物流单号：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_code" placeholder="请输入物流单号"
                               class="layui-input" value="{$data.order_company_express_code}">
                    </div>
                    <label class="layui-form-label">设备数量：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_nums" placeholder="请输入寄出数量"
                               class="layui-input" value="{$data.order_company_express_nums}">
                    </div>
                </div>
<!--                2222222222222222222222222222222222222222222-->
                <div class="ibox-title" style="clear: both;">
                    <h5>物流2</h5>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_name2" class="layui-input" value="{$express2.order_user_name}">
                    </div>
                    <label class="layui-form-label">收件人电话：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_phone2" maxlength="11" class="layui-input "
                               value="{$express2.order_user_phone}">
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="order_user_address2" class="layui-input "
                               value="{$express2.order_user_address}">
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs12">
                    <label class="layui-form-label">物流公司：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_company2"
                               placeholder="请输入物流公司" class="layui-input" value="{$express2.order_company_express_company}">
                    </div>
                    <label class="layui-form-label">物流单号：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_code2" placeholder="请输入物流单号"
                               class="layui-input" value="{$express2.order_company_express_code}">
                    </div>
                    <label class="layui-form-label">设备数量：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_nums2" placeholder="请输入寄出数量"
                               class="layui-input" value="{$express2.order_company_express_nums}">
                    </div>
                </div>
<!--                3333333333333333333333333333-->
                <div class="ibox-title" style="clear: both;">
                    <h5>物流3</h5>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_name3" class="layui-input" value="{$express3.order_user_name}">
                    </div>
                    <label class="layui-form-label">收件人电话：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_user_phone3" maxlength="11" class="layui-input "
                               value="{$express3.order_user_phone}">
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                    <label class="layui-form-label">收件人地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="order_user_address3" class="layui-input "
                               value="{$express3.order_user_address}">
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs-offset1 layui-col-xs12">
                    <label class="layui-form-label">物流公司：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_company3"
                               placeholder="请输入物流公司" class="layui-input" value="{$express3.order_company_express_company}">
                    </div>
                    <label class="layui-form-label">物流单号：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_code3" placeholder="请输入物流单号"
                               class="layui-input" value="{$express3.order_company_express_code}">
                    </div>
                    <label class="layui-form-label">设备数量：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_company_express_nums3" placeholder="请输入寄出数量"
                               class="layui-input" value="{$express3.order_company_express_nums}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                    </button>
                    <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer" /}
<script>
    layui.use(['form'], function () {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('button').addClass('layui-disabled').attr('disabled', 'disabled');
            $.ajax({
                url: "{:url('orderSend')}",
                type: 'post',
                dataType: 'json',
                data: data.field,
                success: function (res) {
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 1500, shade: 0.1}, function (index) {
                            wk.layer_close();
                        })
                    } else {
                        $("button").removeClass('layui-disabled').removeAttr('disabled');
                        wk.error(res.msg);
                        return false;
                    }
                }
            })
        });
        form.on('radio(showExpre)', function (data) {
            if (data.value == 1) {
                $('.showwuliu').removeClass('hidden');
            } else {
                $('.showwuliu').addClass('hidden');
            }
        });
    });
</script>
</body>
</html>